#ifndef _CAD_SLICER_OUTPUT_H_
#define _CAD_SLICER_OUPTUT_H_

#include <iostream>

#include <assimp/vector3.h>


inline std::ostream&
operator <<(
    std::ostream& stream, aiVector3D const& vec)
{ return stream << '[' << vec.x << ',' << vec.y << ',' << vec.z << ']'; }


inline std::ostream&
operator <<(
    std::ostream& stream,
    cadslicer::triangle_intersection const& inter)
{
  return stream
      << "("
      << inter.first.ids[0]
      << (*reinterpret_cast<aiVector3D const*>(inter.first.ids[0]))
      << "," << inter.first.ids[1]
      << (*reinterpret_cast<aiVector3D const*>(inter.first.ids[1]))
      << ") ("
      << inter.second.ids[0]
      << (*reinterpret_cast<aiVector3D const*>(inter.second.ids[0]))
      << "," << inter.second.ids[1]
      << (*reinterpret_cast<aiVector3D const*>(inter.second.ids[1]))<< ")";
}


inline std::ostream&
operator <<(
    std::ostream& stream,
    cadslicer::triangle_id const& triangle)
{
  return stream
      << (*reinterpret_cast<aiVector3D const*>(triangle.ids[0])) << " "
      << (*reinterpret_cast<aiVector3D const*>(triangle.ids[1])) << " "
      << (*reinterpret_cast<aiVector3D const*>(triangle.ids[2]));
}

inline std::ostream&
operator <<(
    std::ostream& stream,
    cadslicer::edge_id const& edge)
{
  return stream
      << "(" << edge.ids[0]
      << (*reinterpret_cast<aiVector3D const*>(edge.ids[0]))
      << ',' << edge.ids[1]
      << (*reinterpret_cast<aiVector3D const*>(edge.ids[1]))
      << ")";
}

#endif // _CAD_SLICER_OUPTUT_H_
